Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
' Draw the object in a metafile.
Private Sub TwoDObject_DrawInMetafile(ByVal mf_dc As Long)
SetMetafileDrawingParameters Me, mf_dc
Arc mf_dc, _
X1, Y1, _
X2, Y2, _
X2, Y1, _
X2, Y1
RestoreMetafileDrawingParameters mf_dc
End Sub
' Return the object's DrawWidth.
Public Property Get TwoDObject_DrawWidth() As Integer
TwoDObject_DrawWidth = m_DrawWidth
End Property
' Set the object's DrawWidth.
Public Property Let TwoDObject_DrawWidth(ByVal new_value As Integer)
m_DrawWidth = new_value
End Property
' Return the object's DrawStyle.
Public Property Get TwoDObject_DrawStyle() As DrawStyleConstants
TwoDObject_DrawStyle = m_DrawStyle
End Property
' Set the object's DrawStyle.
Public Property Let TwoDObject_DrawStyle(ByVal new_value As DrawStyleConstants)
m_DrawStyle = new_value
End Property
' Return the object's ForeColor.
Public Property Get TwoDObject_ForeColor() As OLE_COLOR
TwoDObject_ForeColor = m_ForeColor
End Property
' Set the object's ForeColor.
Public Property Let TwoDObject_ForeColor(ByVal new_value As OLE_COLOR)
m_ForeColor = new_value
End Property
' Return the object's FillColor.
Public Property Get TwoDObject_FillColor() As OLE_COLOR
TwoDObject_FillColor = m_FillColor
End Property
' Set the object's FillColor.
Public Property Let TwoDObject_FillColor(ByVal new_value As OLE_COLOR)
m_FillColor = new_value
End Property
' Return the object's FillStyle.
Public Property Get TwoDObject_FillStyle() As FillStyleConstants
TwoDObject_FillStyle = m_FillStyle
End Property
' Set the object's FillStyle.
Public Property Let TwoDObject_FillStyle(ByVal new_value As FillStyleConstants)
m_FillStyle = new_value
End Property
' Return this object's bounds.
Public Sub TwoDObject_Bound(ByRef xmin As Single, ByRef xmax As Single, ByRef ymin As Single, ByRef ymax As Single)
If X1 < X2 Then
xmin = X1
xmax = X2
Else
xmin = X2
xmax = X1
End If
If Y1 < Y2 Then
ymin = Y1
ymax = Y2
Else
ymin = Y2
ymax = Y1
End If
End Sub
' Draw the object on the canvas.
Public Sub TwoDObject_Draw(ByVal canvas As Object)